import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        System.out.println("请输入一组带字母的字符串：");
        while (true) {
            String str = sc.nextLine();
            boolean b = containsZimu(str);
            if (b){
                int bigCount = getBigCount(str);
                System.out.println("bigCount = " + bigCount);
                break;
            }else {
                System.out.println("重新输入");
            }
        }
    }

    private static int getBigCount(String str) {
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c < 'Z' && c > 'A') {
                count++;
            }
        }
        return count;
    }


    public static boolean containsZimu(String s) {
        boolean flag = false;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c > 'a' && c < 'z' || c > 'A' && c < 'Z') {
                flag = true;
                break;
            } 
        }
        return flag;
    }
}
